﻿<Application x:Class="ConverterSystems.Workstation.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:system="clr-namespace:System;assembly=mscorlib">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <system:Boolean x:Key="BooleanTrue">True</system:Boolean>
            <system:Double x:Key="ContentFontSize">14.667</system:Double>

            <!--  TextBlock styles  -->
            <Style x:Key="BasicTextStyle" TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />
                <Setter Property="FontFamily" Value="{DynamicResource ContentFontFamily}" />
                <Setter Property="TextTrimming" Value="WordEllipsis" />
                <Setter Property="TextWrapping" Value="Wrap" />
                <Setter Property="Typography.StylisticSet20" Value="True" />
                <Setter Property="Typography.DiscretionaryLigatures" Value="True" />
            </Style>

            <Style x:Key="BaselineTextStyle"
                   BasedOn="{StaticResource BasicTextStyle}"
                   TargetType="{x:Type TextBlock}">
                <Setter Property="LineHeight" Value="20" />
                <Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
                <Setter Property="RenderTransform">
                    <Setter.Value>
                        <TranslateTransform X="-1" Y="4" />
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="HeaderTextStyle"
                   BasedOn="{StaticResource BaselineTextStyle}"
                   TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="56" />
                <Setter Property="FontWeight" Value="Light" />
                <Setter Property="LineHeight" Value="40" />
                <Setter Property="RenderTransform">
                    <Setter.Value>
                        <TranslateTransform X="-2" Y="8" />
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="SubheaderTextStyle"
                   BasedOn="{StaticResource BaselineTextStyle}"
                   TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="26.667" />
                <Setter Property="FontWeight" Value="Light" />
                <Setter Property="LineHeight" Value="30" />
                <Setter Property="RenderTransform">
                    <Setter.Value>
                        <TranslateTransform X="-1" Y="6" />
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="TitleTextStyle"
                   BasedOn="{StaticResource BaselineTextStyle}"
                   TargetType="{x:Type TextBlock}">
                <Setter Property="FontWeight" Value="SemiBold" />
            </Style>

            <Style x:Key="ItemTextStyle"
                   BasedOn="{StaticResource BaselineTextStyle}"
                   TargetType="{x:Type TextBlock}" />

            <Style x:Key="BodyTextStyle"
                   BasedOn="{StaticResource BaselineTextStyle}"
                   TargetType="{x:Type TextBlock}">
                <Setter Property="FontWeight" Value="Light" />
            </Style>

            <Style x:Key="CaptionTextStyle"
                   BasedOn="{StaticResource BaselineTextStyle}"
                   TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="12" />
            </Style>

            <Style BasedOn="{StaticResource MetroFlatButton}" TargetType="{x:Type Button}">
                <Style.Triggers>
                    <Trigger Property="IsDefault" Value="True">
                        <Setter Property="Foreground" Value="{DynamicResource AccentSelectedColorBrush}" />
                        <Setter Property="BorderBrush" Value="{DynamicResource AccentSelectedColorBrush}" />
                        <Setter Property="Background" Value="{DynamicResource AccentColorBrush}" />
                    </Trigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="TextButtonStyle" TargetType="{x:Type Button}">
                <Setter Property="Background" Value="{DynamicResource TransparentWhiteBrush}" />
                <Setter Property="Foreground" Value="{Binding (TextElement.Foreground), RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}}" />
                <Setter Property="HorizontalContentAlignment" Value="Left" />
                <Setter Property="VerticalContentAlignment" Value="Center" />
                <Setter Property="Padding" Value="1" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid Background="{TemplateBinding Background}">
                                <ContentPresenter x:Name="contentPresenter"
                                                  Margin="{TemplateBinding Padding}"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                  RecognizesAccessKey="True"
                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Background" Value="{DynamicResource SemiTransparentWhiteBrush}" />
                    </Trigger>
                    <Trigger Property="IsPressed" Value="True">
                        <Setter Property="Background" Value="{DynamicResource HighlightBrush}" />
                        <Setter Property="Foreground" Value="White" />
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Foreground" Value="#ADADAD" />
                    </Trigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="ValueBlock" TargetType="{x:Type TextBlock}">
                <Setter Property="Padding" Value="5" />
                <Setter Property="HorizontalAlignment" Value="Right" />
            </Style>

            <Style x:Key="RadioButtonList" TargetType="{x:Type ListBox}">
                <Setter Property="Foreground" Value="{DynamicResource BlackBrush}" />
                <Setter Property="Background" Value="{DynamicResource WhiteBrush}" />
                <Setter Property="BorderBrush" Value="Transparent" />
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="ItemContainerStyle">
                    <Setter.Value>
                        <Style TargetType="{x:Type ListBoxItem}">
                            <Setter Property="Margin" Value="2" />
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                        <RadioButton Content="{TemplateBinding Content}" IsChecked="{Binding IsSelected, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </Application.Resources>
</Application>